Skip to content

[CoreCLR] Code cleanup and filling-in gaps #10148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 26, 2025
Merged

Conversation

grendello
Copy link
Contributor

@grendello grendello commented May 22, 2025

This PR performs a comprehensive code cleanup by converting function parameter types and log messages to use std::string_view literal (sv) syntax and by removing unused or redundant parameters. Key changes include:

Updating function signatures to replace const char* with std::string_view and removal of unused parameters.
Converting logging format strings throughout the codebase to use the new sv literal.
Minor refactoring in host and assembly-related source files to improve code consistency.

@grendello grendello force-pushed the dev/grendel/clr-host-cleanup branch from 543b10a to a7599fb Compare May 23, 2025 14:51
grendello added 4 commits May 26, 2025 09:20
This needs to be revisited after the GC bridge is in. It is also
possible that there is a problem in JI / Mono.Android.dll which
causes this issue.
@grendello grendello force-pushed the dev/grendel/clr-host-cleanup branch from fc706c4 to 43dfecc Compare May 26, 2025 07:20
@grendello grendello requested a review from Copilot May 26, 2025 08:31
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR performs a comprehensive code cleanup by converting function parameter types and log messages to use std::string_view literal (sv) syntax and by removing unused or redundant parameters. Key changes include:

  • Updating function signatures to replace const char* with std::string_view and removal of unused parameters.
  • Converting logging format strings throughout the codebase to use the new sv literal.
  • Minor refactoring in host and assembly-related source files to improve code consistency.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/native/clr/include/runtime-base/util.hh Updated set_environment_variable_for_directory() parameter type to use std::string_view.
src/native/clr/include/host/runtime-util.hh Updated get_class_from_runtime_field() parameter type to std::string_view.
src/native/clr/include/host/assembly-store.hh Removed the force_rw parameter from get_assembly_data() to simplify the API.
src/native/clr/host/typemap.cc Updated log_debug() and log_warn() calls to include sv literal suffix.
src/native/clr/host/runtime-util.cc Updated get_class_from_runtime_field() to use std::string_view and .data() accordingly.
src/native/clr/host/pinvoke-override.cc Converted logging calls to use the sv literal and ensured consistent formatting.
src/native/clr/host/os-bridge.cc Updated include directive and logging calls to use RuntimeUtil and sv literal suffix.
src/native/clr/host/internal-pinvokes.cc Disabled a problematic log call (with appropriate comments) and updated logging syntax.
src/native/clr/host/host.cc Added [[maybe_unused]] attributes, updated logging calls to sv literal, and refined env var usage.
src/native/clr/host/host-jni.cc Marked JNI methods with TODO comments for future implementation.
src/native/clr/host/fastdev-assemblies.cc Updated logging calls to use sv literal suffix consistently.
src/native/clr/host/assembly-store.cc Removed force_rw parameter use in get_assembly_data() and updated log messages to sv literal.
Comments suppressed due to low confidence (1)

src/native/clr/include/host/assembly-store.hh:27

  • The removal of the 'force_rw' parameter from get_assembly_data() alters its public API. Please confirm that this change is intentional and that all call sites no longer require the force_rw behavior.
static auto get_assembly_data (AssemblyStoreSingleAssemblyRuntimeData const& e, std::string_view const& name, bool force_rw = false) noexcept -> std::tuple<uint8_t*, uint32_t>;

@grendello grendello marked this pull request as ready for review May 26, 2025 08:52
@grendello grendello merged commit a3d4825 into main May 26, 2025
59 checks passed
@grendello grendello deleted the dev/grendel/clr-host-cleanup branch May 26, 2025 09:01
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant